package com.wwl.cms.utils.designModeTest.command;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/9 18:05
 * @description:
 */
public class Client {
    public static void main(String[] args) {
        LightReceiver lightReceiver = new LightReceiver();
        LightOnCommand lightOnCommand = new LightOnCommand(lightReceiver);
        LightOffCommand lightOffCommand = new LightOffCommand(lightReceiver);
        //需要一个遥控器
        RemoteController remoteController = new RemoteController();
       /* remoteController.setCommand(0,lightOnCommand,lightOffCommand);
        System.out.println("-------按下等的开按钮-------");
        remoteController.onButtonWasPushed(0);
        System.out.println("-------按下灯的关按钮-------");
        remoteController.offButtonWasPushed(0);
        System.out.println("-------按下撤销按钮----------");
        remoteController.undoButtonWasPushed();*/

        TVReceiver tvReceiver = new TVReceiver();
        TVOffCommand tvOffCommand = new TVOffCommand(tvReceiver);
        TVOnCommand tvOnCommand = new TVOnCommand(tvReceiver);
        remoteController.setCommand(1,tvOnCommand,tvOffCommand);
        remoteController.onButtonWasPushed(1);
        remoteController.offButtonWasPushed(1);
        remoteController.undoButtonWasPushed();
    }
}
